<script setup>
import {ref,onMounted} from 'vue';
import{useRoute} from 'vue-router'
import http from '@/untils/http.js'
const route = useRoute();
let id = route.params.id;

const user=ref(null);



const getUser=async()=>{
    const response = await http.get("/uesr/getUserById",{
        params:{id:id}
    },)
    user.value=response.data;
};



onMounted(()=>{
    console.log('请求用户信息')
    getUser()
})


</script>


<template>
    <div>
        <h1>个人中心</h1>
        <el-row v-if="list-length>0">
            <el-col :span="4">
                <el-card v-for="user in list" :key="user.id">
                    <p>{{ user?.name }}</p>
                    <p>{{ user?.gender }}</p>
                    <p>{{ user?.birthday }}</p>
                    <p>{{ user?.email}}</p>
                    <p>{{ user?.bio }}</p>
                    
                </el-card>
                
            </el-col>
            
        </el-row>
    </div>
</template>